
package com.zy.ems.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.zy.ems.common.base.BaseEntity;

public class QuestionRecordEntity extends BaseEntity {
    private static final long serialVersionUID = 1L;


    /**
     * 试题记录ID(db_column: id)
     */
    private Integer id;

    /**
     * 试题ID(db_column: question_id)
     */
    private Integer questionId;

    /**
     * 存放JSON对象，题目所在试卷信息(db_column: paper_id)
     */
    private String paperId;

    /**
     * 答错次数(db_column: wrong_count)
     */
    private Integer wrongCount;

    /**
     * 答对次数(db_column: right_count)
     */
    private Integer rightCount;


    public QuestionRecordEntity(){
    }

    public QuestionRecordEntity(
            Integer id
            ){
        this.id = id;
    }


    public Integer getId() {
        return this.id;
    }

    public void setId(Integer value) {
        this.id = value;
    }

    public Integer getQuestionId() {
        return this.questionId;
    }

    public void setQuestionId(Integer value) {
        this.questionId = value;
    }

    public String getPaperId() {
        return this.paperId;
    }

    public void setPaperId(String value) {
        this.paperId = value;
    }

    public Integer getWrongCount() {
        return this.wrongCount;
    }

    public void setWrongCount(Integer value) {
        this.wrongCount = value;
    }

    public Integer getRightCount() {
        return this.rightCount;
    }

    public void setRightCount(Integer value) {
        this.rightCount = value;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("Id", getId())
            .append("QuestionId", getQuestionId())
            .append("PaperId", getPaperId())
            .append("WrongCount", getWrongCount())
            .append("RightCount", getRightCount())
            .toString();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder()
            .append(getId())
            .toHashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if(!(obj instanceof QuestionRecordEntity)) {
            return false;
        }
        if(this == obj) {
            return true;
        }
        QuestionRecordEntity other = (QuestionRecordEntity) obj;
        return new EqualsBuilder()
            .append(getId(), other.getId())
            .isEquals();
    }
}

